
#2.35 1 bp44 20 2.35 

#mxyz=$3
#mb=$2
#me=$4
#adz=$1
#bdz=$5


mxyz=mol_2.xyz
mb=1
me=22
adz=1.86
bdz=1.86





xyzout=tr_$mxyz

topl=0.000000/16.656530/9.422356 
topr=0.000000/16.656530/21.777945 

xyztr $mxyz -tO $mb -o tmpM.xyz
xyzrot tmpM.xyz -r2o $me z
xyztr tmpM.xyz -tto $mb $topl
xyztr tmpM.xyz -tz $adz

mz=$(xyzread tmpM.xyz -z "$mb%$me")

nm=$(awk ' { if(NR==1) print $1} ' tmpM.xyz)  #'
a3z=$(echo |awk "{print 23.55589-2.35+$adz+$bdz+$mz} " ) 
a3y=$(echo |awk '{print 16.6656-1.6656}')
nn=$(echo |awk "{print 250+$nm}") 

echo $nn > $xyzout
echo "7.212489     12.492398    -0.000000        -7.212489    12.492398    -0.000000        0.000000     $a3y   $a3z" >> $xyzout
echo "Au      -5.769991     9.993918    -0.000000 
Au      -4.327494     7.495439     0.000000 
Au      -4.327494    12.492398    -0.000000 
Au      -2.884996     4.996959     0.000000 
Au      -2.884996     9.993918    -0.000000 
Au      -2.884996    14.990877    -0.000000 
Au      -1.442498     2.498480     0.000000 
Au      -1.442498     7.495439     0.000000 
Au      -1.442498    12.492398    -0.000000 
Au      -1.442498    17.489357    -0.000000 
Au       0.000000     0.000000     0.000000 
Au       0.000000     4.996959     0.000000 
Au       0.000000     9.993918    -0.000000 
Au       0.000000    14.990877    -0.000000 
Au       0.000000    19.987836    -0.000000 
Au       1.442498     2.498480     0.000000 
Au       1.442498     7.495439     0.000000 
Au       1.442498    12.492398    -0.000000 
Au       1.442498    17.489357    -0.000000 
Au       2.884996     4.996959     0.000000 
Au       2.884996     9.993918    -0.000000 
Au       2.884996    14.990877    -0.000000 
Au       4.327494     7.495439     0.000000 
Au       4.327494    12.492398    -0.000000 
Au       5.769991     9.993918    -0.000000 
Au      -5.769991    11.659571     2.355589 
Au      -4.327494     9.161092     2.355589 
Au      -4.327494    14.158051     2.355589 
Au      -2.884996     6.662612     2.355589 
Au      -2.884996    11.659571     2.355589 
Au      -2.884996    16.656530     2.355589 
Au      -1.442498     4.164133     2.355589 
Au      -1.442498     9.161092     2.355589 
Au      -1.442498    14.158051     2.355589 
Au      -1.442498    19.155010     2.355589 
Au       0.000000     1.665653     2.355589 
Au       0.000000     6.662612     2.355589 
Au       0.000000    11.659571     2.355589 
Au       0.000000    16.656530     2.355589 
Au       0.000000    21.653489     2.355589 
Au       1.442498     4.164133     2.355589 
Au       1.442498     9.161092     2.355589 
Au       1.442498    14.158051     2.355589 
Au       1.442498    19.155010     2.355589 
Au       2.884996     6.662612     2.355589 
Au       2.884996    11.659571     2.355589 
Au       2.884996    16.656530     2.355589 
Au       4.327494     9.161092     2.355589 
Au       4.327494    14.158051     2.355589 
Au       5.769991    11.659571     2.355589 
Au      -5.769991    13.325224     4.711178 
Au      -4.327494    10.826745     4.711178 
Au      -4.327494    15.823704     4.711178 
Au      -2.884996     8.328265     4.711178 
Au      -2.884996    13.325224     4.711178 
Au      -2.884996    18.322183     4.711178 
Au      -1.442498     5.829786     4.711178 
Au      -1.442498    10.826745     4.711178 
Au      -1.442498    15.823704     4.711178 
Au      -1.442498    20.820663     4.711178 
Au       0.000000     3.331306     4.711178 
Au       0.000000     8.328265     4.711178 
Au       0.000000    13.325224     4.711178 
Au       0.000000    18.322183     4.711178 
Au       0.000000    23.319142     4.711178 
Au       1.442498     5.829786     4.711178 
Au       1.442498    10.826745     4.711178 
Au       1.442498    15.823704     4.711178 
Au       1.442498    20.820663     4.711178 
Au       2.884996     8.328265     4.711178 
Au       2.884996    13.325224     4.711178 
Au       2.884996    18.322183     4.711178 
Au       4.327494    10.826745     4.711178 
Au       4.327494    15.823704     4.711178 
Au       5.769991    13.325224     4.711178 
Au      -5.769991    14.990877     7.066767 
Au      -4.327494    12.492398     7.066768 
Au      -4.327494    17.489357     7.066767 
Au      -2.884996     9.993918     7.066767 
Au      -2.884996    14.990877     7.066767 
Au      -2.884996    19.987836     7.066767 
Au      -1.442498     7.495439     7.066767 
Au      -1.442498    12.492398     7.066768 
Au      -1.442498    17.489357     7.066767 
Au      -1.442498    22.486316     7.066767 
Au       0.000000     4.996959     7.066767 
Au       0.000000     9.993918     7.066767 
Au       0.000000    14.990877     7.066767 
Au       0.000000    19.987836     7.066767 
Au       0.000000    24.984796     7.066767 
Au       1.442498     7.495439     7.066767 
Au       1.442498    12.492398     7.066768 
Au       1.442498    17.489357     7.066767 
Au       1.442498    22.486316     7.066767 
Au       2.884996     9.993918     7.066767 
Au       2.884996    14.990877     7.066767 
Au       2.884996    19.987836     7.066767 
Au       4.327494    12.492398     7.066768 
Au       4.327494    17.489357     7.066767 
Au       5.769991    14.990877     7.066767 
Au      -5.769991    16.656530     9.422356 
Au      -4.327494    14.158051     9.422356 
Au      -4.327494    19.155010     9.422356 
Au      -2.884996    11.659571     9.422356 
Au      -2.884996    16.656530     9.422356 
Au      -2.884996    21.653490     9.422356 
Au      -1.442498     9.161092     9.422357 
Au      -1.442498    14.158051     9.422356 
Au      -1.442498    19.155010     9.422356 
Au      -1.442498    24.151969     9.422356 
Au       0.000000     6.662612     9.422357 
Au       0.000000    11.659571     9.422356 
Au       0.000000    16.656530     9.422356 
Au       0.000000    21.653490     9.422356 
Au       0.000000    26.650448     9.422356 
Au       1.442498     9.161092     9.422357 
Au       1.442498    14.158051     9.422356 
Au       1.442498    19.155010     9.422356 
Au       1.442498    24.151969     9.422356 
Au       2.884996    11.659571     9.422356 
Au       2.884996    16.656530     9.422356 
Au       2.884996    21.653490     9.422356 
Au       4.327494    14.158051     9.422356 
Au       4.327494    19.155010     9.422356 
Au       5.769991    16.656530     9.422356 " >> $xyzout
awk 'NR>2 {print $0}' tmpM.xyz >> $xyzout
echo "Au      -5.769991    18.322183    11.777945 
Au      -4.327494    15.823704    11.777945 
Au      -4.327494    20.820663    11.777945 
Au      -2.884996    13.325224    11.777945 
Au      -2.884996    18.322183    11.777945 
Au      -2.884996    23.319142    11.777945 
Au      -1.442498    10.826745    11.777945 
Au      -1.442498    15.823704    11.777945 
Au      -1.442498    20.820663    11.777945 
Au      -1.442498    25.817622    11.777945 
Au       0.000000     8.328265    11.777945 
Au       0.000000    13.325224    11.777945 
Au       0.000000    18.322183    11.777945 
Au       0.000000    23.319142    11.777945 
Au       0.000000    28.316101    11.777945 
Au       1.442498    10.826745    11.777945 
Au       1.442498    15.823704    11.777945 
Au       1.442498    20.820663    11.777945 
Au       1.442498    25.817622    11.777945 
Au       2.884996    13.325224    11.777945 
Au       2.884996    18.322183    11.777945 
Au       2.884996    23.319142    11.777945 
Au       4.327494    15.823704    11.777945 
Au       4.327494    20.820663    11.777945 
Au       5.769991    18.322183    11.777945 
Au      -5.769991    19.987836    14.133534 
Au      -4.327494    17.489357    14.133534 
Au      -4.327494    22.486316    14.133534 
Au      -2.884996    14.990877    14.133534 
Au      -2.884996    19.987836    14.133534 
Au      -2.884996    24.984795    14.133534 
Au      -1.442498    12.492398    14.133534 
Au      -1.442498    17.489357    14.133534 
Au      -1.442498    22.486316    14.133534 
Au      -1.442498    27.483275    14.133534 
Au       0.000000     9.993918    14.133534 
Au       0.000000    14.990877    14.133534 
Au       0.000000    19.987836    14.133534 
Au       0.000000    24.984795    14.133534 
Au       0.000000    29.981754    14.133534 
Au       1.442498    12.492398    14.133534 
Au       1.442498    17.489357    14.133534 
Au       1.442498    22.486316    14.133534 
Au       1.442498    27.483275    14.133534 
Au       2.884996    14.990877    14.133534 
Au       2.884996    19.987836    14.133534 
Au       2.884996    24.984795    14.133534 
Au       4.327494    17.489357    14.133534 
Au       4.327494    22.486316    14.133534 
Au       5.769991    19.987836    14.133534 
Au      -5.769991    21.653489    16.489123 
Au      -4.327494    19.155010    16.489123 
Au      -4.327494    24.151969    16.489123 
Au      -2.884996    16.656530    16.489123 
Au      -2.884996    21.653489    16.489123 
Au      -2.884996    26.650448    16.489123 
Au      -1.442498    14.158051    16.489123 
Au      -1.442498    19.155010    16.489123 
Au      -1.442498    24.151969    16.489123 
Au      -1.442498    29.148928    16.489123 
Au       0.000000    11.659571    16.489123 
Au       0.000000    16.656530    16.489123 
Au       0.000000    21.653489    16.489123 
Au       0.000000    26.650448    16.489123 
Au       0.000000    31.647407    16.489123 
Au       1.442498    14.158051    16.489123 
Au       1.442498    19.155010    16.489123 
Au       1.442498    24.151969    16.489123 
Au       1.442498    29.148928    16.489123 
Au       2.884996    16.656530    16.489123 
Au       2.884996    21.653489    16.489123 
Au       2.884996    26.650448    16.489123 
Au       4.327494    19.155010    16.489123 
Au       4.327494    24.151969    16.489123 
Au       5.769991    21.653489    16.489123 
Au      -5.769991    23.319142    18.844712 
Au      -4.327494    20.820663    18.844713 
Au      -4.327494    25.817622    18.844712 
Au      -2.884996    18.322183    18.844712 
Au      -2.884996    23.319142    18.844712 
Au      -2.884996    28.316101    18.844712 
Au      -1.442498    15.823704    18.844712 
Au      -1.442498    20.820663    18.844713 
Au      -1.442498    25.817622    18.844712 
Au      -1.442498    30.814581    18.844712 
Au       0.000000    13.325224    18.844712 
Au       0.000000    18.322183    18.844712 
Au       0.000000    23.319142    18.844712 
Au       0.000000    28.316101    18.844712 
Au       0.000000    33.313061    18.844712 
Au       1.442498    15.823704    18.844712 
Au       1.442498    20.820663    18.844713 
Au       1.442498    25.817622    18.844712 
Au       1.442498    30.814581    18.844712 
Au       2.884996    18.322183    18.844712 
Au       2.884996    23.319142    18.844712 
Au       2.884996    28.316101    18.844712 
Au       4.327494    20.820663    18.844713 
Au       4.327494    25.817622    18.844712 
Au       5.769991    23.319142    18.844712 
Au      -5.769991    24.984795    21.200301 
Au      -4.327494    22.486316    21.200301 
Au      -4.327494    27.483275    21.200301 
Au      -2.884996    19.987836    21.200301 
Au      -2.884996    24.984795    21.200301 
Au      -2.884996    29.981755    21.200301 
Au      -1.442498    17.489357    21.200302 
Au      -1.442498    22.486316    21.200301 
Au      -1.442498    27.483275    21.200301 
Au      -1.442498    32.480234    21.200301 
Au       0.000000    14.990877    21.200302 
Au       0.000000    19.987836    21.200301 
Au       0.000000    24.984795    21.200301 
Au       0.000000    29.981755    21.200301 
Au       0.000000    34.978713    21.200301 
Au       1.442498    17.489357    21.200302 
Au       1.442498    22.486316    21.200301 
Au       1.442498    27.483275    21.200301 
Au       1.442498    32.480234    21.200301 
Au       2.884996    19.987836    21.200301 
Au       2.884996    24.984795    21.200301 
Au       2.884996    29.981755    21.200301 
Au       4.327494    22.486316    21.200301 
Au       4.327494    27.483275    21.200301 
Au       5.769991    24.984795    21.200301 " | awk "{print \$1,\$2,\$3-1.6656,\$4-2.35+$adz+$bdz+$mz}" >> $xyzout

rm tmpM.xyz 

